package net.jjjshop.common.service.lbt;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import net.jjjshop.common.entity.lbt.UserBillEntityRequest;
import net.jjjshop.common.entity.user.UserBill;
import net.jjjshop.common.entity.user.UserDedicateRecord;

import java.math.BigDecimal;
import java.util.List;

/**
 * UserBillService 接口实现
 */
public interface UserBillService extends IService<UserBill> {

//    /**
//     * 列表
//     *
//     * @param request          请求参数
//     * @param pageParamRequest 分页类参数
//     * @return List<UserBill>
//     */
//    List<UserBill> getList(FundsMonitorSearchRequest request, PageParamRequest pageParamRequest);

    /**
     * 新增/消耗  总金额
     *
     * @param pm       Integer 0 = 支出 1 = 获得
     * @param userId   Integer 用户uid
     * @param category String 类型
     * @param date     String 时间范围
     * @param type     String 小类型
     * @return UserBill
     */
    BigDecimal getSumBigDecimal(Integer pm, Integer userId, String category, String date, String type);



    /**
     * 保存明细
     * @param title
     * @param type
     * @param pm
     * @param num
     * @param uid
     * @return
     */
    Boolean saveBill(String title, String type, Integer pm, BigDecimal num,Integer uid,Integer yjType,Integer orderId);

    /**
     * 保存明细
     * @param title
     * @param type
     * @param pm
     * @param num
     * @param uid
     * @return
     */
    Boolean saveBill(String title, String type, Integer pm, BigDecimal num,Integer uid,Integer yjType,String mark,Integer orderId);

    /**
     * 单纯的记录添加
     * @param title
     * @param type
     * @param pm
     * @param num
     * @param uid
     * @param yjType
     * @return
     */
    Boolean addBillRecord(String title,String type,Integer pm,BigDecimal num,Integer uid, Integer yjType);


    Boolean addBillRecord(String title,String type,Integer pm,BigDecimal num,Integer uid, Integer yjType,Integer orderId);

    /**
     * 获取权益卡收益总额
     * @return
     */
    Double getTzTotal();

    /**
     * 查询用户扶持次数
     * @param uid
     * @return
     */
    Integer selectUserHelpNum(Integer uid);


    /**
     * 查询用户记录
     * @param uid
     * @param type 0：支持，1收入
     * @param category 类型
     * @param
     * @return
     */
    IPage<UserBill> userBillRecord(Integer uid, Integer type, String category, Integer page, Integer limit);


    IPage<UserBillEntityRequest> userBillList(UserBillEntityRequest request, Integer page, Integer limit);

    /**
     * 查询基金捐赠记录
     * @return
     */
    List<UserDedicateRecord> getUserDedicateRecord();
}
